#include "wxsnewwindowdlg.h"
#include "wxwidgetsres.h"
#include "wxsdialogres.h"
#include "wxsscrollingdialogres.h"
#include "wxsframeres.h"
#include "wxspanelres.h"
#include "wxwidgetsgui.h"
#include "wxsitemresdata.h"
#include "../wxsmith.h"
#include "../wxsproject.h"
#include <logmanager.h>
#include <projectmanager.h>
#include <M_Code_project.h>
#include <projectfile.h>
#include <wx/intl.h>
#include <wx/string.h>

namespace {
  wxString GetPathPart( const wxString& FileName ) {
    for( size_t i = FileName.Length(); i-- > 0; ) {
      if( FileName[i] == _T( '/' ) || FileName[i] == _T( '\\' ) ) {
        return FileName.Mid( 0, i + 1 );
      }
    }
    return wxEmptyString;
  }

  wxString GetNoExt( const wxString& FileName ) {
    for( size_t i = FileName.Length(); i-- > 0; ) {
      if( FileName[i] == _T( '/' ) || FileName[i] == _T( '\\' ) ) {
        return FileName;
      }
      if( FileName[i] == _T( '.' ) ) {
        return FileName.Mid( 0, i );
      }
    }
    return FileName;
  }
}

const long wxsNewWindowDlg::ID_TEXTCTRL1 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL2 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL3 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX1 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL4 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX3 = wxNewId();
const long wxsNewWindowDlg::ID_BUTTON1 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX2 = wxNewId();
const long wxsNewWindowDlg::ID_COMBOBOX1 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL8 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX4 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL5 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL6 = wxNewId();
const long wxsNewWindowDlg::ID_BUTTON2 = wxNewId();
const long wxsNewWindowDlg::ID_BUTTON3 = wxNewId();
const long wxsNewWindowDlg::ID_BUTTON4 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX5 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX9 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX6 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX10 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX7 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX11 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX8 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX12 = wxNewId();
const long wxsNewWindowDlg::ID_TEXTCTRL7 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX14 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX15 = wxNewId();
const long wxsNewWindowDlg::ID_CHECKBOX13 = wxNewId();

BEGIN_EVENT_TABLE( wxsNewWindowDlg, wxScrollingDialog )
  EVT_BUTTON( wxID_OK, wxsNewWindowDlg::OnCreate )
  EVT_BUTTON( wxID_CANCEL, wxsNewWindowDlg::OnCancel )
END_EVENT_TABLE()

wxsNewWindowDlg::wxsNewWindowDlg( wxWindow* parent, const wxString& ResType, wxsProject* Project ):
  m_SourceNotTouched( true ),
  m_HeaderNotTouched( true ),
  m_XrcNotTouched( true ),
  m_BlockText( false ),
  m_AdvOpsShown( true ),
  m_Type( ResType ),
  m_Project( Project ) {
  wxStaticText* StaticText10;
  wxStaticText* StaticText9;
  wxFlexGridSizer* FlexGridSizer4;
  wxStaticText* StaticText2;
  wxFlexGridSizer* FlexGridSizer3;
  wxStaticText* StaticText6;
  wxStaticText* StaticText8;
  wxStaticText* StaticText11;
  wxFlexGridSizer* FlexGridSizer2;
  wxStaticText* StaticText1;
  wxStaticText* StaticText3;
  wxStaticBoxSizer* StaticBoxSizer3;
  wxStaticText* StaticText5;
  wxStaticText* StaticText7;
  wxFlexGridSizer* FlexGridSizer1;
  wxStaticText* StaticText4;
  wxStdDialogButtonSizer* StdDialogButtonSizer1;
  Create( parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T( "wxID_ANY" ) );
  m_RootSizer = new wxBoxSizer( wxVERTICAL );
  StaticBoxSizer3 = new wxStaticBoxSizer( wxHORIZONTAL, this, _T( "Options" ) );
  FlexGridSizer1 = new wxFlexGridSizer( 0, 2, 5, 5 );
  FlexGridSizer1->AddGrowableCol( 1 );
  StaticText1 = new wxStaticText( this, wxID_ANY, _T( "Class Name:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer1->Add( StaticText1, 0, wxALIGN_CENTER_VERTICAL, 5 );
  m_Class = new wxTextCtrl( this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize( 80, -1 ), 0, wxDefaultValidator, _T( "ID_TEXTCTRL1" ) );
  FlexGridSizer1->Add( m_Class, 0, wxEXPAND, 5 );
  StaticText2 = new wxStaticText( this, wxID_ANY, _T( "Header file:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer1->Add( StaticText2, 0, wxALIGN_CENTER_VERTICAL, 5 );
  m_Header = new wxTextCtrl( this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize( 80, -1 ), 0, wxDefaultValidator, _T( "ID_TEXTCTRL2" ) );
  FlexGridSizer1->Add( m_Header, 0, wxEXPAND, 5 );
  StaticText3 = new wxStaticText( this, wxID_ANY, _T( "Source file:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer1->Add( StaticText3, 0, wxALIGN_CENTER_VERTICAL, 5 );
  m_Source = new wxTextCtrl( this, ID_TEXTCTRL3, wxEmptyString, wxDefaultPosition, wxSize( 80, -1 ), 0, wxDefaultValidator, _T( "ID_TEXTCTRL3" ) );
  FlexGridSizer1->Add( m_Source, 0, wxEXPAND, 5 );
  m_UseXrc = new wxCheckBox( this, ID_CHECKBOX1, _T( "Xrc File:" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX1" ) );
  m_UseXrc->SetValue( false );
  FlexGridSizer1->Add( m_UseXrc, 0, wxALIGN_CENTER_VERTICAL, 5 );
  m_Xrc = new wxTextCtrl( this, ID_TEXTCTRL4, wxEmptyString, wxDefaultPosition, wxSize( 80, -1 ), 0, wxDefaultValidator, _T( "ID_TEXTCTRL4" ) );
  FlexGridSizer1->Add( m_Xrc, 0, wxEXPAND, 5 );
  FlexGridSizer1->Add( 10, 6, 1, wxEXPAND, 5 );
  m_XRCAutoload = new wxCheckBox( this, ID_CHECKBOX3, _T( "Add XRC file to autoload list" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX3" ) );
  m_XRCAutoload->SetValue( false );
  m_XRCAutoload->Disable();
  FlexGridSizer1->Add( m_XRCAutoload, 1, wxEXPAND, 5 );
  StaticBoxSizer3->Add( FlexGridSizer1, 1, wxALL | wxEXPAND, 0 );
  m_RootSizer->Add( StaticBoxSizer3, 0, wxALL | wxEXPAND, 0 );
  m_AdvOps = new wxButton( this, ID_BUTTON1, _T( "+ Advanced options" ), wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxNO_BORDER, wxDefaultValidator, _T( "ID_BUTTON1" ) );
  m_RootSizer->Add( m_AdvOps, 0, wxLEFT | wxRIGHT | wxEXPAND, 0 );
  m_AdvancedOptionsSizer = new wxStaticBoxSizer( wxVERTICAL, this, wxEmptyString );
  FlexGridSizer2 = new wxFlexGridSizer( 0, 2, 5, 5 );
  FlexGridSizer2->AddGrowableCol( 1 );
  m_UsePCH = new wxCheckBox( this, ID_CHECKBOX2, _T( "Use PCH:" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX2" ) );
  m_UsePCH->SetValue( false );
  FlexGridSizer2->Add( m_UsePCH, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_Pch = new wxComboBox( this, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T( "ID_COMBOBOX1" ) );
  FlexGridSizer2->Add( m_Pch, 1, wxEXPAND, 5 );
  BoxSizer1 = new wxBoxSizer( wxHORIZONTAL );
  BoxSizer1->Add( 21, 16, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0 );
  StaticText11 = new wxStaticText( this, wxID_ANY, _T( "PCH guard define:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  BoxSizer1->Add( StaticText11, 1, wxALIGN_CENTER_VERTICAL, 0 );
  FlexGridSizer2->Add( BoxSizer1, 0, wxALL | wxEXPAND, 0 );
  m_PchGuard = new wxTextCtrl( this, ID_TEXTCTRL8, _T( "WX_PRECOMP" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL8" ) );
  FlexGridSizer2->Add( m_PchGuard, 0, wxEXPAND, 0 );
  m_UseInitFunc = new wxCheckBox( this, ID_CHECKBOX4, _T( "Init code in function:" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX4" ) );
  m_UseInitFunc->SetValue( false );
  FlexGridSizer2->Add( m_UseInitFunc, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_InitFunc = new wxTextCtrl( this, ID_TEXTCTRL5, _T( "BuildContent" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL5" ) );
  m_InitFunc->Disable();
  FlexGridSizer2->Add( m_InitFunc, 1, wxEXPAND, 5 );
  StaticText4 = new wxStaticText( this, wxID_ANY, _T( "Base class name:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer2->Add( StaticText4, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_BaseClass = new wxTextCtrl( this, ID_TEXTCTRL6, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL6" ) );
  FlexGridSizer2->Add( m_BaseClass, 1, wxEXPAND, 5 );
  StaticText7 = new wxStaticText( this, wxID_ANY, _T( "Scopes:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer2->Add( StaticText7, 0, wxALIGN_CENTER_VERTICAL, 0 );
  FlexGridSizer4 = new wxFlexGridSizer( 0, 3, 0, 5 );
  FlexGridSizer4->AddGrowableCol( 0 );
  FlexGridSizer4->AddGrowableCol( 1 );
  FlexGridSizer4->AddGrowableCol( 2 );
  StaticText8 = new wxStaticText( this, wxID_ANY, _T( "IDs:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer4->Add( StaticText8, 1, wxALIGN_CENTER_VERTICAL, 5 );
  StaticText9 = new wxStaticText( this, wxID_ANY, _T( "Members:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer4->Add( StaticText9, 1, wxALIGN_CENTER_VERTICAL, 5 );
  StaticText10 = new wxStaticText( this, wxID_ANY, _T( "Handlers:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer4->Add( StaticText10, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_ScopeIds = new wxButton( this, ID_BUTTON2, _T( "Public" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_BUTTON2" ) );
  FlexGridSizer4->Add( m_ScopeIds, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_ScopeMembers = new wxButton( this, ID_BUTTON3, _T( "Public" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_BUTTON3" ) );
  FlexGridSizer4->Add( m_ScopeMembers, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_ScopeHandlers = new wxButton( this, ID_BUTTON4, _T( "Public" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_BUTTON4" ) );
  FlexGridSizer4->Add( m_ScopeHandlers, 1, wxALIGN_CENTER_VERTICAL, 5 );
  FlexGridSizer2->Add( FlexGridSizer4, 0, wxEXPAND, 0 );
  StaticText5 = new wxStaticText( this, wxID_ANY, _T( "Constructor arguments:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer2->Add( StaticText5, 1, wxALIGN_CENTER_VERTICAL, 5 );
  FlexGridSizer3 = new wxFlexGridSizer( 0, 2, 0, 10 );
  FlexGridSizer3->AddGrowableCol( 0 );
  FlexGridSizer3->AddGrowableCol( 1 );
  m_CtorParent = new wxCheckBox( this, ID_CHECKBOX5, _T( "Parent" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX5" ) );
  m_CtorParent->SetValue( true );
  FlexGridSizer3->Add( m_CtorParent, 1, wxEXPAND, 5 );
  m_CtorParentDef = new wxCheckBox( this, ID_CHECKBOX9, _T( "Def. value" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX9" ) );
  m_CtorParentDef->SetValue( false );
  FlexGridSizer3->Add( m_CtorParentDef, 1, wxEXPAND, 5 );
  m_CtorId = new wxCheckBox( this, ID_CHECKBOX6, _T( "Id" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX6" ) );
  m_CtorId->SetValue( true );
  FlexGridSizer3->Add( m_CtorId, 1, wxEXPAND, 5 );
  m_CtorIdDef = new wxCheckBox( this, ID_CHECKBOX10, _T( "Def. value" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX10" ) );
  m_CtorIdDef->SetValue( true );
  FlexGridSizer3->Add( m_CtorIdDef, 1, wxEXPAND, 5 );
  m_CtorPos = new wxCheckBox( this, ID_CHECKBOX7, _T( "Position" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX7" ) );
  m_CtorPos->SetValue( false );
  FlexGridSizer3->Add( m_CtorPos, 1, wxEXPAND, 5 );
  m_CtorPosDef = new wxCheckBox( this, ID_CHECKBOX11, _T( "Def. value" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX11" ) );
  m_CtorPosDef->SetValue( true );
  m_CtorPosDef->Disable();
  FlexGridSizer3->Add( m_CtorPosDef, 1, wxEXPAND, 5 );
  m_CtorSize = new wxCheckBox( this, ID_CHECKBOX8, _T( "Size" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX8" ) );
  m_CtorSize->SetValue( false );
  FlexGridSizer3->Add( m_CtorSize, 1, wxEXPAND, 5 );
  m_CtorSizeDef = new wxCheckBox( this, ID_CHECKBOX12, _T( "Def. value" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX12" ) );
  m_CtorSizeDef->SetValue( true );
  m_CtorSizeDef->Disable();
  FlexGridSizer3->Add( m_CtorSizeDef, 1, wxEXPAND, 5 );
  FlexGridSizer2->Add( FlexGridSizer3, 1, wxEXPAND, 5 );
  StaticText6 = new wxStaticText( this, wxID_ANY, _T( "Custom arguments:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "wxID_ANY" ) );
  FlexGridSizer2->Add( StaticText6, 1, wxALIGN_CENTER_VERTICAL, 5 );
  m_CtorCustom = new wxTextCtrl( this, ID_TEXTCTRL7, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL7" ) );
  FlexGridSizer2->Add( m_CtorCustom, 1, wxEXPAND, 5 );
  m_AdvancedOptionsSizer->Add( FlexGridSizer2, 1, wxEXPAND, 5 );
  m_UseFwdDecl = new wxCheckBox( this, ID_CHECKBOX14, _T( "Use forward declarations" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX14" ) );
  m_UseFwdDecl->SetValue( false );
  m_AdvancedOptionsSizer->Add( m_UseFwdDecl, 0, wxTOP | wxEXPAND, 5 );
  m_UseI18n = new wxCheckBox( this, ID_CHECKBOX15, _T( "Use internationalisation (translatable applications)" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX15" ) );
  m_UseI18n->SetValue( true );
  m_AdvancedOptionsSizer->Add( m_UseI18n, 0, wxTOP | wxEXPAND, 5 );
  m_AddWxs = new wxCheckBox( this, ID_CHECKBOX13, _T( "Add wxs file to project" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX13" ) );
  m_AddWxs->SetValue( true );
  m_AdvancedOptionsSizer->Add( m_AddWxs, 0, wxTOP | wxEXPAND, 5 );
  m_RootSizer->Add( m_AdvancedOptionsSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5 );
  StdDialogButtonSizer1 = new wxStdDialogButtonSizer();
  StdDialogButtonSizer1->AddButton( new wxButton( this, wxID_OK, wxEmptyString ) );
  StdDialogButtonSizer1->AddButton( new wxButton( this, wxID_CANCEL, wxEmptyString ) );
  StdDialogButtonSizer1->Realize();
  m_RootSizer->Add( StdDialogButtonSizer1, 0, wxTOP | wxALIGN_CENTER_HORIZONTAL, 5 );
  SetSizer( m_RootSizer );
  m_RootSizer->Fit( this );
  m_RootSizer->SetSizeHints( this );
  Center();
  Connect( ID_TEXTCTRL1, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxsNewWindowDlg::OnClassChanged ) );
  Connect( ID_TEXTCTRL2, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxsNewWindowDlg::OnHeaderChanged ) );
  Connect( ID_TEXTCTRL3, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxsNewWindowDlg::OnSourceChanged ) );
  Connect( ID_CHECKBOX1, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnUseXrcChange ) );
  Connect( ID_TEXTCTRL4, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxsNewWindowDlg::OnXrcChanged ) );
  Connect( ID_BUTTON1, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnAdvOpsClick ) );
  Connect( ID_CHECKBOX2, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnUsePCHClick ) );
  Connect( ID_CHECKBOX4, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnUseInitFuncClick ) );
  Connect( ID_BUTTON2, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnScopeIdsClick ) );
  Connect( ID_BUTTON3, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnScopeMembersClick ) );
  Connect( ID_BUTTON4, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnScopeHandlersClick ) );
  Connect( ID_CHECKBOX5, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorParentClick ) );
  Connect( ID_CHECKBOX9, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorParentDefClick ) );
  Connect( ID_CHECKBOX6, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorIdClick ) );
  Connect( ID_CHECKBOX10, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorIdDefClick ) );
  Connect( ID_CHECKBOX7, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorPosClick ) );
  Connect( ID_CHECKBOX11, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorPosDefClick ) );
  Connect( ID_CHECKBOX8, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorSizeClick ) );
  Connect( ID_CHECKBOX12, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxsNewWindowDlg::OnCtorSizeDefClick ) );
  ConfigManager* Cfg = Manager::Get()->GetConfigManager( _T( "wxsmith" ) );
  m_BlockText = true;
  m_SourceDirectory = Cfg->Read( _T( "/newresource/sourcedirectory" ), _T( "" ) );
  wxString StrippedName = ResType.Mid( 2 );
  wxString ResName = F( _T( "New%s" ), StrippedName.c_str() );
  m_Class->SetValue( ResName );
  m_Source->SetValue( m_SourceDirectory + ResName + _T( ".cpp" ) );
  m_Header->SetValue( m_SourceDirectory + ResName + _T( ".h" ) );
  m_Xrc ->SetValue( m_SourceDirectory + ResName + _T( ".xrc" ) );
  m_Xrc->Disable();
  SetTitle( F( _T( "New %s resource" ), ResType.c_str() ) );
  DetectPchFile();
  m_BaseClass->SetValue( ResType );
  wxCommandEvent event;
  OnAdvOpsClick( event );
  Center();
  m_AppManaged = m_Project->GetGUI() && m_Project->GetGUI()->GetName() == _T( "wxWidgets" ) &&
                 m_Project->GetGUI()->CheckIfApplicationManaged();
  m_XRCAutoload->SetValue( m_AppManaged );
  m_UseInitFunc->SetValue( Cfg->ReadBool( _T( "/newresource/useinitfunc" ), m_UseInitFunc->GetValue() ) );
  m_InitFunc->Enable( m_UseInitFunc->GetValue() );
  m_InitFunc->SetValue( Cfg->Read( _T( "/newresource/initfunc" ), m_InitFunc->GetValue() ) );
  m_CtorParent->SetValue( Cfg->ReadBool( _T( "/newresource/ctorparent" ), m_CtorParent->GetValue() ) );
  m_CtorParentDef->Enable( m_CtorParent->GetValue() );
  m_CtorParentDef->SetValue( Cfg->ReadBool( _T( "/newresource/ctorparentdef" ), m_CtorParentDef->GetValue() ) );
  m_CtorId->SetValue( Cfg->ReadBool( _T( "/newresource/ctorid" ), m_CtorId->GetValue() ) );
  m_CtorIdDef->Enable( m_CtorId->GetValue() );
  m_CtorIdDef->SetValue( Cfg->ReadBool( _T( "/newresource/ctorid" ), m_CtorIdDef->GetValue() ) );
  m_CtorPos->SetValue( Cfg->ReadBool( _T( "/newresource/ctorpos" ), m_CtorPos->GetValue() ) );
  m_CtorPosDef->Enable( m_CtorPos->GetValue() );
  m_CtorPosDef->SetValue( Cfg->ReadBool( _T( "/newresource/ctorpos" ), m_CtorPosDef->GetValue() ) );
  m_CtorSize->SetValue( Cfg->ReadBool( _T( "/newresource/ctorsize" ), m_CtorSize->GetValue() ) );
  m_CtorSizeDef->Enable( m_CtorSize->GetValue() );
  m_CtorSizeDef->SetValue( Cfg->ReadBool( _T( "/newresource/ctorsize" ), m_CtorSizeDef->GetValue() ) );
  m_UseXrc->SetValue( Cfg->ReadBool( _T( "/newresource/usexrc" ), m_UseXrc->GetValue() ) );
  m_Xrc->Enable( m_UseXrc->GetValue() );
  m_XRCAutoload->SetValue( Cfg->ReadBool( _T( "/newresource/xrcautoloag" ), m_XRCAutoload->GetValue() ) );
  m_AddWxs->SetValue( Cfg->ReadBool( _T( "/newresource/addwxs" ), m_AddWxs->GetValue() ) );
  m_ScopeIdsVal = ( wxsItemRes::NewResourceParams::Scope )Cfg->ReadInt( _T( "/newresource/scopeids" ), ( int )wxsItemRes::NewResourceParams::Protected );
  m_ScopeMembersVal = ( wxsItemRes::NewResourceParams::Scope )Cfg->ReadInt( _T( "/newresource/scopemembers" ), ( int )wxsItemRes::NewResourceParams::Public );
  m_ScopeHandlersVal = ( wxsItemRes::NewResourceParams::Scope )Cfg->ReadInt( _T( "/newresource/scopehandlers" ), ( int )wxsItemRes::NewResourceParams::Private );
  m_UseFwdDecl->SetValue( Cfg->ReadBool( _T( "/newresource/usefwddecl" ), m_UseFwdDecl->GetValue() ) );
  m_UseI18n->SetValue( Cfg->ReadBool( _T( "/newresource/usei18n" ), m_UseI18n->GetValue() ) );
  m_PchGuard->SetValue( Cfg->Read( _T( "/newresource/pchguard" ), m_PchGuard->GetValue() ) );
  UpdateScopeButtons();
  OnUseXrcChange( event );
  m_BlockText = false;
}

wxsNewWindowDlg::~wxsNewWindowDlg() {
}

void wxsNewWindowDlg::OnCancel( M_Code_unused wxCommandEvent& event ) {
  EndModal( wxID_CANCEL );
}

void wxsNewWindowDlg::OnCreate( M_Code_unused wxCommandEvent& event ) {
  bool CreateXrc = m_UseXrc->GetValue();
  M_Code_Project* cbProj = m_Project->GetM_Code_Project();
  wxsItemRes::NewResourceParams Params;
  Params.Class = m_Class->GetValue();
  Params.Src = m_Source->GetValue();
  Params.Hdr = m_Header->GetValue();
  Params.Xrc = CreateXrc ? m_Xrc->GetValue() : _T( "" );
  Params.Pch = m_Pch->GetValue();
  Params.Wxs = _T( "" );
  Params.InitFunc = m_InitFunc->GetValue();
  Params.BaseClass = m_BaseClass->GetValue();
  Params.CustomCtorArgs = m_CtorCustom->GetValue();
  Params.UsePch = m_UsePCH->GetValue();
  Params.UseInitFunc = m_UseInitFunc->GetValue();
  Params.CtorParent = m_CtorParent->GetValue();
  Params.CtorParentDef  = m_CtorParentDef->GetValue();
  Params.CtorId = m_CtorId->GetValue();
  Params.CtorIdDef = m_CtorIdDef->GetValue();
  Params.CtorPos = m_CtorPos->GetValue();
  Params.CtorPosDef = m_CtorPosDef->GetValue();
  Params.CtorSize = m_CtorSize->GetValue();
  Params.CtorSizeDef = m_CtorSizeDef->GetValue();
  Params.ScopeIds = m_ScopeIdsVal;
  Params.ScopeMembers = m_ScopeMembersVal;
  Params.ScopeHandlers = m_ScopeHandlersVal;
  Params.UseFwdDecl = m_UseFwdDecl->GetValue();
  Params.UseI18n = m_UseI18n->GetValue();
  Params.PchGuard = m_PchGuard->GetValue();
  if( !wxsCodeMarks::ValidateIdentifier( wxsCPP, Params.Class ) ) {
    wxMessageBox( _T( "Invalid class name" ) );
    return;
  }
  if( !wxsCodeMarks::ValidateIdentifier( wxsCPP, Params.BaseClass ) ) {
    wxMessageBox( _T( "Invalid name of base class" ) );
    return;
  }
  if( Params.UseInitFunc && !wxsCodeMarks::ValidateIdentifier( wxsCPP, Params.InitFunc ) ) {
    wxMessageBox( _T( "Invalid name of init function" ) );
    return;
  }
  if( m_Project->FindResource( Params.Class ) ) {
    wxMessageBox( F( _T( "Resource '%s' already exists" ), Params.Class.c_str() ) );
    return;
  }
  if( Params.UsePch && ( Params.PchGuard.IsEmpty() || !wxsCodeMarks::ValidateIdentifier( wxsCPP, Params.PchGuard ) ) ) {
    wxMessageBox( _T( "Invalid name of pch guard" ) );
    return;
  }
  wxString ProjectPrefix = m_Project->GetProjectPath();
  Params.GenHdr = true;
  if( wxFileName::FileExists( ProjectPrefix + Params.Hdr ) ) {
    switch( wxMessageBox( F( _T( "File '%s' already exists. Overwrite it ?" ), Params.Hdr.c_str() ),
                          _T( "File exists" ),
                          wxYES_NO | wxCANCEL | wxICON_ERROR ) ) {
      case wxCANCEL:
        return;
      case wxNO:
        Params.GenHdr = false;
        break;
      default:
        return;
    }
  }
  Params.GenSrc = true;
  if( wxFileName::FileExists( ProjectPrefix + Params.Src ) ) {
    switch( wxMessageBox( F( _T( "File '%s' already exists. Overwrite it ?" ), Params.Src.c_str() ),
                          _T( "File exists" ), wxYES_NO | wxCANCEL | wxICON_ERROR ) ) {
      case wxCANCEL:
        return;
      case wxNO:
        Params.GenSrc = false;
        break;
      default:
        return;
    }
  }
  Params.GenXrc = CreateXrc;
  if( wxFileName::FileExists( ProjectPrefix + Params.Xrc ) ) {
    Params.GenXrc = false;
  }
  wxWindow* OkBtn = FindWindowById( wxID_OK );
  if( OkBtn ) {
    OkBtn->Disable();
  }
  wxsItemRes* NewResource = 0;
  if( m_Type == _T( "wxDialog" ) ) {
    NewResource = new wxsDialogRes( m_Project );
  } else if( m_Type == _T( "wxScrollingDialog" ) ) {
    NewResource = new wxsScrollingDialogRes( m_Project );
  } else if( m_Type == _T( "wxFrame" ) ) {
    NewResource = new wxsFrameRes( m_Project );
  } else if( m_Type == _T( "wxPanel" ) ) {
    NewResource = new wxsPanelRes( m_Project );
  } else {
    Manager::Get()->GetLogManager()->DebugLog( _T( "wxSmith: Internal error: unknown type when creating resource" ) );
    EndModal( wxID_CANCEL );
    return;
  }
  if( !NewResource->CreateNewResource( Params ) ) {
    delete NewResource;
    Manager::Get()->GetLogManager()->DebugLog( _T( "wxSmith: Couldn't generate new resource" ) );
    EndModal( wxID_CANCEL );
    return;
  }
  wxsItemResData* Data = NewResource->BuildResData( 0 );
  Data->BeginChange();
  if( !PrepareResource( NewResource, Data ) ) {
    wxMessageBox( _T( "Error while initializing resource" ) );
    Data->EndChange();
    delete Data;
    delete NewResource;
    EndModal( wxID_CANCEL );
    return;
  }
  if( !m_Project->AddResource( NewResource ) ) {
    wxMessageBox( _T( "Error while adding new resource into project" ) );
    Data->EndChange();
    delete Data;
    delete NewResource;
    EndModal( wxID_CANCEL );
    return;
  }
  Data->EndChange();
  Data->Save();
  delete Data;
  if( m_AppManaged && CreateXrc && m_XRCAutoload->GetValue() && !Params.Xrc.IsEmpty() ) {
    wxWidgetsGUI* GUI = wxDynamicCast( m_Project->GetGUI(), wxWidgetsGUI );
    if( GUI ) {
      wxArrayString& AutoList = GUI->GetLoadedResources();
      if( AutoList.Index( Params.Xrc ) == wxNOT_FOUND ) {
        AutoList.Add( Params.Xrc );
        GUI->RebuildApplicationCode();
      }
    }
  }
  wxArrayInt Targets;
  Manager::Get()->GetProjectManager()->AddFileToProject( Params.Hdr, cbProj, Targets );
  if( Targets.GetCount() != 0 ) {
    Manager::Get()->GetProjectManager()->AddFileToProject( Params.Src, cbProj, Targets );
    if( !Params.Wxs.IsEmpty() && m_AddWxs->GetValue() ) {
      Manager::Get()->GetProjectManager()->AddFileToProject( Params.Wxs, cbProj, Targets );
    }
  }
  Manager::Get()->GetProjectManager()->GetUI().RebuildTree();
  NewResource->EditOpen();
  ConfigManager* Cfg = Manager::Get()->GetConfigManager( _T( "wxsmith" ) );
  Cfg->Write( _T( "/newresource/useinitfunc" ), m_UseInitFunc->GetValue() );
  Cfg->Write( _T( "/newresource/initfunc" ), m_InitFunc->GetValue() );
  Cfg->Write( _T( "/newresource/ctorparent" ), m_CtorParent->GetValue() );
  Cfg->Write( _T( "/newresource/ctorparentdef" ), m_CtorParentDef->GetValue() );
  Cfg->Write( _T( "/newresource/ctorid" ), m_CtorId->GetValue() );
  Cfg->Write( _T( "/newresource/ctorid" ), m_CtorIdDef->GetValue() );
  Cfg->Write( _T( "/newresource/ctorpos" ), m_CtorPos->GetValue() );
  Cfg->Write( _T( "/newresource/ctorpos" ), m_CtorPosDef->GetValue() );
  Cfg->Write( _T( "/newresource/ctorsize" ), m_CtorSize->GetValue() );
  Cfg->Write( _T( "/newresource/ctorsize" ), m_CtorSizeDef->GetValue() );
  Cfg->Write( _T( "/newresource/usexrc" ), m_UseXrc->GetValue() );
  Cfg->Write( _T( "/newresource/xrcautoloag" ), m_XRCAutoload->GetValue() );
  Cfg->Write( _T( "/newresource/addwxs" ), m_AddWxs->GetValue() );
  Cfg->Write( _T( "/newresource/scopeids" ), ( int )m_ScopeIdsVal );
  Cfg->Write( _T( "/newresource/scopemembers" ), ( int )m_ScopeMembersVal );
  Cfg->Write( _T( "/newresource/scopehandlers" ), ( int )m_ScopeHandlersVal );
  Cfg->Write( _T( "/newresource/sourcedirectory" ), m_SourceDirectory );
  Cfg->Write( _T( "/newresource/usefwddecl" ), m_UseFwdDecl->GetValue() );
  Cfg->Write( _T( "/newresource/usei18n" ), m_UseI18n->GetValue() );
  Cfg->Write( _T( "/newresource/pchguard" ), m_PchGuard->GetValue() );
  EndModal( wxID_OK );
}

void wxsNewWindowDlg::OnClassChanged( M_Code_unused wxCommandEvent& event ) {
  if( m_BlockText ) {
    return;
  }
  m_BlockText = true;
  if( m_HeaderNotTouched ) {
    m_Header->SetValue( m_SourceDirectory + m_Class->GetValue() + _T( ".h" ) );
  }
  if( m_SourceNotTouched ) {
    m_Source->SetValue( m_SourceDirectory + m_Class->GetValue() + _T( ".cpp" ) );
  }
  if( m_XrcNotTouched ) {
    m_Xrc-> SetValue( m_SourceDirectory + m_Class->GetValue() + _T( ".xrc" ) );
  }
  m_BlockText = false;
}

void wxsNewWindowDlg::OnSourceChanged( M_Code_unused wxCommandEvent& event ) {
  if( m_BlockText ) {
    return;
  }
  m_BlockText = true;
  m_SourceNotTouched = false;
  m_BlockText = false;
}

void wxsNewWindowDlg::OnHeaderChanged( M_Code_unused wxCommandEvent& event ) {
  if( m_BlockText ) {
    return;
  }
  m_BlockText = true;
  m_SourceDirectory = GetPathPart( m_Header->GetValue() );
  wxString Base = GetNoExt( m_Header->GetValue() );
  if( m_SourceNotTouched ) {
    m_Source->SetValue( Base + _T( ".cpp" ) );
  }
  if( m_XrcNotTouched ) {
    m_Xrc->SetValue( Base + _T( ".h" ) );
  }
  m_HeaderNotTouched = false;
  m_BlockText = false;
}

void wxsNewWindowDlg::OnUseXrcChange( M_Code_unused wxCommandEvent& event ) {
  m_Xrc->Enable( m_UseXrc->GetValue() );
  m_XRCAutoload->Enable( m_UseXrc->GetValue() && m_AppManaged );
  if( m_UseXrc->GetValue() ) {
    m_CtorParent->SetValue( true );
    m_CtorId->SetValue( false );
    m_CtorPos->SetValue( false );
    m_CtorSize->SetValue( false );
    m_CtorParent->Disable();
    m_CtorId->Disable();
    m_CtorPos->Disable();
    m_CtorSize->Disable();
    m_CtorParentDef->Enable();
    m_CtorIdDef->Disable();
    m_CtorPosDef->Disable();
    m_CtorSizeDef->Disable();
  } else {
    m_CtorParent->Enable();
    m_CtorId->Enable();
    m_CtorPos->Enable();
    m_CtorSize->Enable();
  }
}

void wxsNewWindowDlg::OnXrcChanged( M_Code_unused wxCommandEvent& event ) {
  if( m_BlockText ) {
    return;
  }
  m_BlockText = true;
  m_XrcNotTouched = false;
  m_BlockText = false;
}

wxString wxsNewWindowDlg::DetectPchFile() {
  M_Code_Project* Proj = m_Project->GetM_Code_Project();
  for( FilesList::iterator it = Proj->GetFilesList().begin(); it != Proj->GetFilesList().end(); ++it ) {
    ProjectFile* File = *it;
    if( File && File->file.GetExt() == _T( "h" ) && File->compile ) {
      int Index = m_Pch->Append( File->relativeFilename );
      if( File->file.GetFullName() == _T( "wx_pch.h" ) ) {
        m_Pch->SetSelection( Index );
      }
    }
  }
  if( m_Pch->GetCount() == 0 ) {
    m_UsePCH->SetValue( false );
    m_Pch->Disable();
  } else {
    m_UsePCH->SetValue( true );
    if( m_Pch->GetSelection() == wxNOT_FOUND ) {
      m_Pch->SetSelection( 0 );
    }
  }
  return m_Pch->GetStringSelection();
}

void wxsNewWindowDlg::OnUsePCHClick( M_Code_unused wxCommandEvent& event ) {
  m_Pch->Enable( m_UsePCH->GetValue() );
  m_PchGuard->Enable( m_UsePCH->GetValue() );
}

void wxsNewWindowDlg::OnCtorParentClick( M_Code_unused wxCommandEvent& event ) {
  m_CtorParentDef->Enable( m_CtorParent->GetValue() );
}

void wxsNewWindowDlg::OnCtorIdClick( M_Code_unused wxCommandEvent& event ) {
  m_CtorIdDef->Enable( m_CtorId->GetValue() );
}

void wxsNewWindowDlg::OnCtorPosClick( M_Code_unused wxCommandEvent& event ) {
  m_CtorPosDef->Enable( m_CtorPos->GetValue() );
}

void wxsNewWindowDlg::OnCtorSizeClick( M_Code_unused wxCommandEvent& event ) {
  m_CtorSizeDef->Enable( m_CtorSize->GetValue() );
}

void wxsNewWindowDlg::OnCtorParentDefClick( M_Code_unused wxCommandEvent& event ) {
  if( m_CtorParentDef->GetValue() ) {
    m_CtorIdDef->SetValue( true );
    m_CtorPosDef->SetValue( true );
    m_CtorSizeDef->SetValue( true );
  } else {
  }
}

void wxsNewWindowDlg::OnCtorIdDefClick( M_Code_unused wxCommandEvent& event ) {
  if( m_CtorIdDef->GetValue() ) {
    m_CtorPosDef->SetValue( true );
    m_CtorSizeDef->SetValue( true );
  } else {
    m_CtorParentDef->SetValue( false );
  }
}

void wxsNewWindowDlg::OnCtorPosDefClick( M_Code_unused wxCommandEvent& event ) {
  if( m_CtorPosDef->GetValue() ) {
    m_CtorSizeDef->SetValue( true );
  } else {
    m_CtorIdDef->SetValue( false );
    m_CtorParentDef->SetValue( false );
  }
}

void wxsNewWindowDlg::OnCtorSizeDefClick( M_Code_unused wxCommandEvent& event ) {
  if( m_CtorSizeDef->GetValue() ) {
  } else {
    m_CtorIdDef->SetValue( false );
    m_CtorParentDef->SetValue( false );
    m_CtorPosDef->SetValue( false );
  }
}

void wxsNewWindowDlg::OnUseInitFuncClick( M_Code_unused wxCommandEvent& event ) {
  m_InitFunc->Enable( m_UseInitFunc->GetValue() );
}

void wxsNewWindowDlg::OnAdvOpsClick( M_Code_unused wxCommandEvent& event ) {
  Freeze();
  m_AdvOpsShown = !m_AdvOpsShown;
  wxString BaseLabel = _T( "Advanced options" );
  if( m_AdvOpsShown ) {
    m_RootSizer->Show( m_AdvancedOptionsSizer );
    m_AdvOps->SetLabel( _T( "- " ) + BaseLabel );
  } else {
    m_RootSizer->Hide( m_AdvancedOptionsSizer );
    m_AdvOps->SetLabel( _T( "+ " ) + BaseLabel );
  }
  SetMinSize( wxSize( 10, 10 ) );
  SetSize( wxSize( 10, 10 ) );
  Layout();
  m_RootSizer->Fit( this );
  m_RootSizer->SetSizeHints( this );
  Thaw();
}

bool wxsNewWindowDlg::PrepareResource( M_Code_unused wxsItemRes* Res, wxsItemResData* Data ) {
  wxsBaseProperties* Props = Data->GetRootItem()->GetBaseProps();
  Props->m_ParentFromArg   = m_CtorParent->GetValue();
  Props->m_IdFromArg       = m_CtorId->GetValue();
  Props->m_PositionFromArg = m_CtorPos->GetValue();
  Props->m_SizeFromArg     = m_CtorSize->GetValue();
  return true;
}

void wxsNewWindowDlg::OnScopeIdsClick( M_Code_unused wxCommandEvent& event ) {
  switch( m_ScopeIdsVal ) {
    case wxsItemRes::NewResourceParams::Public:
      m_ScopeIdsVal = wxsItemRes::NewResourceParams::Protected;
      break;
    case wxsItemRes::NewResourceParams::Protected:
      m_ScopeIdsVal = wxsItemRes::NewResourceParams::Private;
      break;
    case wxsItemRes::NewResourceParams::Private:
    default:
      m_ScopeIdsVal = wxsItemRes::NewResourceParams::Public;
      break;
  }
  UpdateScopeButtons();
}

void wxsNewWindowDlg::OnScopeMembersClick( M_Code_unused wxCommandEvent& event ) {
  switch( m_ScopeMembersVal ) {
    case wxsItemRes::NewResourceParams::Public:
      m_ScopeMembersVal = wxsItemRes::NewResourceParams::Protected;
      break;
    case wxsItemRes::NewResourceParams::Protected:
      m_ScopeMembersVal = wxsItemRes::NewResourceParams::Private;
      break;
    case wxsItemRes::NewResourceParams::Private:
    default:
      m_ScopeMembersVal = wxsItemRes::NewResourceParams::Public;
      break;
  }
  UpdateScopeButtons();
}

void wxsNewWindowDlg::OnScopeHandlersClick( M_Code_unused wxCommandEvent& event ) {
  switch( m_ScopeHandlersVal ) {
    case wxsItemRes::NewResourceParams::Public:
      m_ScopeHandlersVal = wxsItemRes::NewResourceParams::Protected;
      break;
    case wxsItemRes::NewResourceParams::Protected:
      m_ScopeHandlersVal = wxsItemRes::NewResourceParams::Private;
      break;
    case wxsItemRes::NewResourceParams::Private:
    default:
      m_ScopeHandlersVal = wxsItemRes::NewResourceParams::Public;
      break;
  }
  UpdateScopeButtons();
}

void wxsNewWindowDlg::UpdateScopeButtons() {
  switch( m_ScopeIdsVal ) {
    case wxsItemRes::NewResourceParams::Public:
      m_ScopeIds->SetLabel( _T( "Public" ) );
      break;
    case wxsItemRes::NewResourceParams::Protected:
      m_ScopeIds->SetLabel( _T( "Protected" ) );
      break;
    case wxsItemRes::NewResourceParams::Private:
    default:
      m_ScopeIds->SetLabel( _T( "Private" ) );
      break;
  }
  switch( m_ScopeMembersVal ) {
    case wxsItemRes::NewResourceParams::Public:
      m_ScopeMembers->SetLabel( _T( "Public" ) );
      break;
    case wxsItemRes::NewResourceParams::Protected:
      m_ScopeMembers->SetLabel( _T( "Protected" ) );
      break;
    case wxsItemRes::NewResourceParams::Private:
    default:
      m_ScopeMembers->SetLabel( _T( "Private" ) );
      break;
  }
  switch( m_ScopeHandlersVal ) {
    case wxsItemRes::NewResourceParams::Public:
      m_ScopeHandlers->SetLabel( _T( "Public" ) );
      break;
    case wxsItemRes::NewResourceParams::Protected:
      m_ScopeHandlers->SetLabel( _T( "Protected" ) );
      break;
    case wxsItemRes::NewResourceParams::Private:
    default:
      m_ScopeHandlers->SetLabel( _T( "Private" ) );
      break;
  }
}
